<template>
    <div><button @click="goPayment">去支付</button></div>
  </template>
  
  <script setup>
  import { ref } from "vue";
  import axios from "../../utils/axios"
  import qs from "qs";
  let goPayment = () => {
      let data = {
          orderId:'q123567890'
      }
    axios({
      url: "/api/payment",
      method: "post",
      headers: {
        "content-type": "application/x-www-form-urlencoded",
      },
      data:qs.stringify(data)
    }).then((res) => {
      console.log(res);
      window.location.href = res.data.result;
    });
  };
  </script>
  
  <style></style>
  